package com.java.proxy;

public class UserDaoProxy implements IUserDao {

    private IUserDao userDao;

    public UserDaoProxy(IUserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public Integer save(String name) {

        System.out.println("操作前的日志输出。。。。。。");

        Integer count = userDao.save(name);

        System.out.println("操作后的日志输出。。。。。。");

        return count;
    }

    @Override
    public String query(Integer id) {


        System.out.println("操作前的日志输出。。。。。。");

        String result = userDao.query(id);

        System.out.println("操作后的日志输出。。。。。。");

        return result;
    }
}
